import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

/**
 * Created by wangyg 
 * on 2017/6/26 18:30
 */
public class Outer {
	private int a = 0;
	static int b = 1;

	public static class inner {
		int b = 2;

		public void test() {
			System.out.println(Outer.b);
			System.out.println(new Outer().b);
			System.out.println(b);
		}
	}

//	public static void main(String[] args) {
//		//		new inner().test();
//
//		StringBuffer sb = new StringBuffer();
//		StringBuilder sbd = new StringBuilder();
//	}


	//其他 测试验证
	public static void swap(final List list, int i, int j) {
		list.set(i, list.set(j, list.get(i)));
	}

	public static void swap2(List list, int i, int j) {
		list.set(i, list.set(j, list.get(i)));

	}

	public static void main(String[] args) {

		List<Integer> list = Arrays.asList(1, 2, 3, 4);
		List<Integer> list2 = Arrays.asList(1, 2, 3, 4, 5);
//		List l=list;
//		System.out.println(list.set(1,2));
//		swap(list,1,2);
//		swap2(list,1,2);
//		System.out.println(list.toString());
//		l.swap(1,2);
//		System.out.println(l);
//		List l=list;
//		l.set(1,2);

//		List l=new ArrayList(list);
//		l.add(1,2);

//		Integer integer = list.get(1);
//		list.set(1, list.set(2, list.get(1)));
//		System.out.println(list);

		Collections.shuffle(list);
		System.out.println(list);
		Collections.shuffle(list2);
		System.out.println(list2);

	}
}
